package com.itheima.mybatis.mapper;

import com.itheima.mybatis.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * 用户的Mapper
 */
public interface UserMapper {
    @Select("select * from tb_user where username = #{username} and password = #{password}")
    public User selectByUserPassword(@Param("username") String username,
                                     @Param("password") String password);
    @Select("select * from tb_user where username like #{name} ")
    public List<User> queryUsers(String name);

    @Update("update tb_user set password = #{pass} where id = #{id}")
    public Integer updatePassword(@Param("id") Integer id, @Param("pass") String pass);
}
